<h2 class="heading">Events</h2>
<div class="events">
<?php if( isset($isAdmin) && $isAdmin === true ) : ?>
	<a class="add" href="/org/view/<?php echo $currentOrg ?>/events/add">Add event</a>
<?php endif; ?>
<?php if( count($events) === 0 ): ?>
	No events yet.
<?php endif; ?>
<?php foreach( $events as $event ) :  ?> 
<?php if( strtotime( $event['date'] ) > gmmktime() ): ?>		
	<div class="event"> 
<?php else: ?>		
	<div class="event inactive">
		<div class="note">*Finished</div>
<?php endif; ?>
		<a class="show" href="/org/view/<?php echo $currentOrg ?>/events/show/<?php echo $event['event_id'] ?>">View</a>
		<h2><?php echo $event['Event'] ?></h2>
		<p class="date">Date of Event: <?php echo date('M j Y', strtotime($event['date'] . ' ' . $event['starttime'] ) ) ?></p>
		<p class="starttime">Start Time: <?php echo date('h:i:sa', strtotime($event['date']. ' ' . $event['starttime'] ) ) ?></p>
		<p class="endtime">End Time: <?php echo date('h:i:sa', strtotime($event['date'] . ' ' . $event['endtime'] ) ) ?></p>
		
		<p class="venue">Venue: <?php echo $event['venue'] ?></p>
	</div>
<?php endforeach;?> 
</div>